package com.znf4.controller.malls;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.znf4.entity.ApiCommonResultVo;
import com.znf4.good.imgUrl.entity.ImgUrl;
import com.znf4.good.imgUrl.server.ImgUrlServer;

/**
 * 商品多张图片
 */
@RestController
@RequestMapping("/good/imgUrl")
public class ImgUrlController {
	
	
	private static final Logger LOG = LoggerFactory.getLogger(ImgUrlController.class);
	
	
	@Autowired
	private ImgUrlServer imgUrlServer ;
	

	
	/**
	 * 函数功能说明 ： 获取商品所有的图片
	 *
	 * @参数： @return
	 * @return String
	 * @throws
	 */
	@RequestMapping(value = "/queryAll", method = { RequestMethod.POST, RequestMethod.GET })
	public ApiCommonResultVo queryAll(ImgUrl imgUrl) {
		
		try {
			LOG.info("请求参数{}" , imgUrl.toString() );
			List<ImgUrl> list = imgUrlServer.queryAll(imgUrl);
			return new ApiCommonResultVo(0, "", list );
		} catch (Exception e) {
			LOG.info("获取商品所有的图片接口异常 ：" + e.getMessage());
			return new ApiCommonResultVo(-2, "系统异常", "");
		}
		
		
		
	}
	

	

}
